package com.xiaoye.qbproject.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 装备实体关系表
 *
 * @TableName ZB_RELATION
 */
@TableName(value = "ZB_RELATION")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ZbRelation implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 被指向节点
     */
    private String toId;
    /**
     * 起始节点
     */
    private String fromId;
    /**
     * 节点指向描述
     */
    private String text;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ZbRelation other = (ZbRelation) that;
        return (this.getToId() == null ? other.getToId() == null : this.getToId().equals(other.getToId()))
                && (this.getFromId() == null ? other.getFromId() == null : this.getFromId().equals(other.getFromId()))
                && (this.getText() == null ? other.getText() == null : this.getText().equals(other.getText()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getToId() == null) ? 0 : getToId().hashCode());
        result = prime * result + ((getFromId() == null) ? 0 : getFromId().hashCode());
        result = prime * result + ((getText() == null) ? 0 : getText().hashCode());
        return result;
    }

    @Override
    public String toString() {
        String sb = getClass().getSimpleName() +
                " [" +
                "Hash = " + hashCode() +
                ", toId=" + toId +
                ", fromId=" + fromId +
                ", text=" + text +
                ", serialVersionUID=" + serialVersionUID +
                "]";
        return sb;
    }
}